#include "histogram_n_d.h"

using namespace Histogram;

extern "C" __global__ __aicore__ void histogram(GM_ADDR x, GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling) {
    GET_TILING_DATA(tilingData, tiling);

    if (TILING_KEY_IS(101)) {
        HistogramND<DTYPE_X, 1> op;
        op.Init(x, y, &tilingData);
        op.ProcessCached();
    } else if (TILING_KEY_IS(201)) {
        HistogramND<DTYPE_X, 2> op;
        op.Init(x, y, &tilingData);
        op.ProcessNotCached();
    }
}